<template>
	<view>
		<view style="position: relative;z-index: 99;">
			<uni-search-bar :clearButton="none" placeholder="搜索律师名称" @confirm="search"></uni-search-bar>
		</view>
		<ChooseLits ref="chooseLit" :list="list" :arr="arr" @chooseLike="chooseLike" @chooseCountry="chooseCountry"></ChooseLits>
		<view class="lawer-box" @tap="jumpLawerIndex" v-for="item in 10" :key="item">
			<image src="../../static/image/banner.png" mode=""></image>
			<view class="box-right">
				<view class="top">
					<view class="name">
						李小龙律师
					</view>
					<view class="year">
						执业10年
					</view>
				</view>
				<view class="middle">
					<image src="../../static/image/map.png" mode=""></image>
					<view class="">
						广州市
					</view>
					<view class="" style="margin: 0 8rpx;">
						| 
					</view>
					<view class="">
						广东打拳律师事务所
					</view>
				</view>
				<view class="bottom">
					<image src="../../static/image/zan1.png" mode=""></image>
					<view class="lenged">
						债务纠纷(24)
					</view>
				</view>
			</view>
		</view>
		
		
		
		<view class="content">
		    <simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" themeColor='#007AFF'></simple-address>
		</view>
	</view>
</template>

<script>
import uniSearchBar from '@/components/uni-search-bar/uni-search-bar.vue'
import ChooseLits from '../../components/choose-Cade/choose-Cade.vue'
import simpleAddress from "@/components/simple-address/simple-address.nvue"
export default {
	data() {
		return {
			list: ['全部地区', '不限专长', '综合排序'],
			arr: [
				[""],
				['不限专长', '借贷纠纷', '劳动纠纷','继承','房产纠纷','婚姻家事','合同纠纷'],
				['综合排序', '按案例数量', '按执业年限']
			],
			i2: [0, 0, 0],
			cityPickerValueDefault: [0, 0, 1],
			pickerText: ''
		}
	},
	methods: {
		search(e){
			console.log(e.value)
		},
		chooseLike(i1) {
			if (this.i2[i1[0]] != i1[1]) {
				this.i2[i1[0]] = i1[1];
			}
		},
		chooseCountry(){
			this.openAddres()
		},
		openAddres() {
		    this.$refs.simpleAddress.open();
		},
		onConfirm(e) {
		    this.pickerText = JSON.stringify(e)
			this.$set(this.$refs.chooseLit.list,0,e.label.substr(0,3))
		},
		jumpLawerIndex(){
			uni.navigateTo({
				url:"/pages/lawerIndex/lawerIndex?id=1"
			})
		}
	},
	onPullDownRefresh(){
		uni.showLoading({
			title:"加载中..."
		})
		setTimeout(()=>{
			uni.hideLoading()
			uni.stopPullDownRefresh()
		},500)
		
	},
	onReachBottom(){
		uni.showLoading({
			title:"加载中..."
		})
		setTimeout(()=>{
			uni.hideLoading()
		},500)
	},
	components: {
		uniSearchBar,
		ChooseLits,
		simpleAddress
	}
}
</script>

<style lang="scss" scoped>
.lawer-box{
	>image{
		width: 120rpx;
		height: 120rpx;
	}
	border-bottom: 15rpx solid #f2f2f2;
}
.name{
	font-size: 30rpx;
}
	
</style>
